package com.hongdee.insurance.task.controller;

import com.hongdee.insurance.task.service.ITInsuranceTaskSeekHelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/insurance/task/seek/help")
public class TInsuranceSeekHelpController {


    @Autowired
    private ITInsuranceTaskSeekHelpService seekHelpService;

    /**
     * 求助信息分页查询
     * @param uid
     * @param token
     * @param start
     * @param limit
     * @param data
     * @return
     * @throws Exception
     */
    @RequestMapping("/page")
    public Map<String,Object> page(@RequestParam(name = "uid", defaultValue = "") String uid,
                                   @RequestParam(name = "token", defaultValue = "") String token,
                                   @RequestParam(name = "start", defaultValue = "0") String start,
                                   @RequestParam(name = "limit", defaultValue = "50") String limit,
                                   @RequestBody Map data) throws Exception {
        Map<String,Object> map=seekHelpService.queryPage(uid,start,limit,data);
        map.put("success",true);
        map.put("msg","查询成功!!");
        return map;
    }

}
